1. Field of the Invention
The present invention relates to methods for transmitting compressed files across a wide area network. More specifically, the present invention relates to methods for downloading electronic images across the Internet.
2. Description of the Related Art
As the popularity of wide area networks such as the Internet has increased, the need for efficient data communication between computers has also grown. Current computer systems include telephone modems that communicate through the public telephone system at 56,000 bits per second and faster. Ten years ago, standard telephone modems communicated at 300 bits per second. The need for faster data communication has been driven by the complexity of data being transmitted across wide area networks.
One wide-area network that transmits very complex data is the Internet. The Internet can be used to transmit images, sounds and even full motion video. Normally, consumers accessing the Internet use browsing software (a xe2x80x9cBrowserxe2x80x9d) such as the Internet Explorer(copyright) from Microsoft(copyright) Corporation. Browsing software allows consumers to easily view complicated documents that include pictures, sounds, and video.
However, complicated documents can contain one hundred thousand to one million bytes of information, or greater. Thus, it has become increasingly important for consumers to have faster access to the Internet so that they can receive complicated documents in a timely manner.
Others have attempted various mechanisms for increasing the perceived speed of viewing complicated documents across the Internet. For example, most images to be transferred across the Internet are compressed so that a smaller number of bytes are actually transmitted to the consumer""s computer. Once the compressed image has been transmitted to the consumer""s computer, it is decompressed and rendered to the consumer""s display. This is known in the art as data compression.
Using this compression/decompression mechanism decreases the number of bytes transmitted across communication lines, thereby reducing the data transfer time. Although data compression has several advantages, it also poses many problems. Specifically, compressed images can require a long lag time before they are rendered to the screen. This lag time between downloading and rendering an image is called the decompression time.
Some computer systems decompress compressed imagery synchronously. During the decompression time, the entire program is dedicated to this single compression task. The program is unable to perform other tasks until the entire image is decompressed and thus made ready to be rendered on the consumer""s computer screen. While this method of download, decompression and rendering is simple to implement in programming code, it can prove frustrating for the consumer since every image must be rendered before the computer moves on to other tasks.
One way around this problem has been to design programs so that decompression and other program functions are processed in a round-robin fashion. The program loops among the various sub-tasks, with each task being designed to process data for a short period of time before returning to the controlling loop. This method of time sharing is called non-preemptive multi-tasking. Since each sub-task must yield willingly to other pending tasks, the user""s computer is shared in a non-preemptive manner. The disadvantage of this approach is that the sharing among programs happens with a coarse granularity so that the consumer sees halting processes. Images are rendered as the program attempts to perform pieces of all the pending tasks.
Because of the problems discussed above in synchronously decompressing files downloaded from the Internet, other systems have been developed in an attempt to reduce file decompression and rendering times. One development has included the ability to download and decompress each file asynchronously from an Internet server to the consumer""s computer. By asynchronously downloading files, only small packets of each image, sound, or video file are sent from the Internet server to the consumer""s computer at a time. Each packet is thereafter compiled and decompressed on the consumer""s computer to recreate the original file. By only sending portions of the file at a time, two files can be sent simultaneously from the Internet server to the consumer""s computer by interleaving packets from each file. For example, an Internet server might simultaneously send an image file and a voice file to the consumer""s computer by interleaving the data packets from each file.
To handle the multiple files that are being sent from the Internet server with modern PC operating systems, the browser program can be designed to spawn a new thread to decompress each asynchronous image. As is known, xe2x80x9cthreadsxe2x80x9d, are individual units of execution that run within a process (user program) on a computer. These units of execution have a desirable characteristic in that one thread may preempt another at any time. Operating systems that have the ability to run many threads simultaneously are called xe2x80x9cmultithreadedxe2x80x9d systems. Preemptive multithread programs tend to have better perceived response time to the consumer. This is because any task can be interrupted in favor of a higher priority task. In such a scenario, consumer input is a high priority task and can be given more computing resources.
In an asynchronous download system, new threads are initiated to track, decompress and render the data packets from each incoming file. As each thread receives a piece of the asynchronous file, it builds a copy of the original file from all the packets. While this method has advantages over synchronously downloading images, the overhead created by spawning so many extra threads on the consumer""s computer leads to unnecessary overhead, thereby slowing down the system. Thus, this method of asynchronously downloading images and spawning an individual thread to decompress and render each transmitted file has several drawbacks.
It is thus an object of the present invention to provide a system whereby files such as images, sounds and video can be transmitted across a wide area network without the problems associated with the prior art methods of synchronously downloading and spawning individual threads for each downloaded file.
The present invention is a system and method for downloading and efficiently decompressing files across a wide area network such as the Internet using minimal computer resources on the consumer""s computer. To carry out its task, the system of the present invention uses, at minimum, two threads. The first thread, known as the binding thread, manages communication across the Internet between the consumer""s computer and a server computer. For example, the binding thread manages TCP/IP packet transmissions between the consumer""s computer and an Internet server. It should be noted, however, that several threads could act to connect a consumer""s computer with a server computer.
The second thread, known as the worker thread, manages the processes of decoding and decompressing specific files for the consumer""s display. No matter how many compressed files are being downloaded simultaneously from the server computer, only a single worker thread remains active. The worker thread manages decompressing files such as images, sounds and videos. As discussed above, most non-text files such as images, sounds and the like are compressed and encoded so that they can be efficiently transported across wide area networks such as the Internet. Thus, it is necessary for the system of the present invention to convert the compressed files back to their original, uncompressed form.
In the preferred embodiment of the present invention, a consumer runs browsing software to select an Internet page to be viewed. As is known, Internet browsers such as the Internet Explorer(copyright) from Microsoft(copyright) Corporation can be directed to particular sites on the Internet by entering a Universal Resource Locator (URL) to the browser to identify the site of interest. The browser will then resolve the targeted address on the Internet.
Once the browser software accesses the targeted Internet site, the binding thread on the consumer""s computer begins receiving the designated HyperText Markup Language (HTML) document. The consumer""s computer, in conjunction with the browser, parses the HTML document to the consumer""s display. During the parsing process, if the browser software determines that a compressed file such as an image is to be displayed, the downloading and rendering process is initiated.
As a first step in the downloading and rendering process of the present invention, the binding thread instantiates a rendering object which, as described below, has the ability to paint a bitmap image on demand to the consumer""s computer display. If a single worker thread has not yet been initialized, the binding thread starts a new worker thread on the consumer""s computer. As discussed below, a single binding thread handles the download for each compressed file while a single worker thread manages decompressing multiple compressed files from each of the active binding threads to the consumer""s computer display.
Once a worker thread has been initialized and a particular compressed file identified for download, a data buffer object is instantiated on the consumer""s computer by commands from the binding thread. The data buffer object includes memory which receives and temporarily stores the incoming stream of asynchronous compressed data so that it can be processed at a later time. After commands within the binding thread have instantiated a data buffer object, the data buffer object is handed the address (or moniker) of the compressed file to be downloaded and decompressed. The data buffer object then provides an interface to the designated address to begin asynchronously downloading data into the data buffer object memory.
As the first block of data arrives from the downloading compressed file, its MIME type is determined by the buffer object. As is known, the MIME type of a file relates to the structure of the incoming file. A MIME type can be used to determine the type of decompression algorithm to run to decompress the file. For example, certain MIME types are GIF, JPEG, and the like.
Once the MIME type of the file is determined, the binding thread runs commands that instantiate an appropriate decoder object to decode the downloading file. The binding thread selects a decompressor by using a table to match the MIME type of the downloading file with the corresponding decompressor. The decoder object then acts within the context of the worker thread to retrieve the buffered data from the memory of the buffer object and decode it to a bitmap file. As discussed above, most non-text files such as images are compressed and encoded using a particular algorithm so that they can be efficiently transported across wide area networks such as the Internet. Thus, the decoder object is necessary to convert the compressed file back to its original format.
Because each type of compressed file requires its own decoding algorithm, a specific decoder object must be instantiated to decode the particular type of incoming file and store any temporary information that is generated. Accordingly, many different types of decoders are available for decoding data from the buffer object""s memory. For example, a compressed file such as a JPEG image would be decoded with a JPEG decoder object. The present invention includes many other types of decoder objects such as those that read JPEG and GIF type files.
As the decoder object decodes compressed images from the buffer object""s memory to a bitmap file, the rendering object that was instantiated previously by the binding thread begins to simultaneously read the bitmap file. While the rendering object reads image data from the bitmap file, it simultaneously begins requests for rendering the compressed file to the consumer""s computer.
As multiple compressed files are asynchronously sent to the consumer""s computer from an Internet server, a single worker thread coordinates decoding and rendering each compressed file to the display. Thus, the decoding and rendering functions of the worker thread are separated from the communication functions provided by the binding thread. This two-threaded approach provides speed and efficiency advantages over prior systems which only utilized a single thread for downloading, decoding and rendering compressed files.
In addition, the system of the present invention is more efficient than prior systems which required a new thread to be initialized for every compressed file downloaded from an Internet server to a consumer""s computer. As discussed above, some prior systems asynchronously download files using a first thread, and then spawned new threads to decode and render every downloaded file. Therefore, many threads were initialized to decode and render all the different image files that might have been present, in a single, complicated document.
For example, one HTML Internet page may have five image files embedded within a single page. As the Internet browser parses an HTML document, each image that is to be rendered in the page is asynchronously downloaded from the Internet server to the consumer""s computer. In prior systems, a complicated page might have spawned six or more new threads within the consumer""s computer. Because each thread required system resources, the performance of the consumer""s computer in prior systems degraded with each new thread. Though the actual amount of memory and CPU resources varies from operating system to operation system. The net result is sluggish performance such that no task performs adequately. The system suffers poor response time to the user""s commands.
The system of the present invention, in contrast, avoids the pitfalls of prior systems by allowing asynchronous downloads of compressed files in an environment by utilizing only a single thread to decompress all of the incoming compressed files. In the present invention, only two threads can manage downloading a multitude of compressed files. A single binding thread can instantiate a buffer and rendering object for each downloading file, while a multitude of decoder objects can be decompressing image data from the buffer objects within the context of a single worker thread. The rendering object thereafter renders the downloaded file to the consumer""s display. However, it should be noted that more than one binding thread may be spawned to manage asynchronously downloading the image files from the Internet server to the consumer""s computer.
Decompression is a computationally intensive activity. By containing all decompression activity into a single thread, the system has the ability to temporarily suspend such activity in favor of more urgent needs. In addition, the use of a single worker thread for decompression activities minimizes the use of the resources that the computer""s operation system uses to provide preemptive multithreading. Thus, the system of the present invention provides a balanced usage of all computer resources and a more efficient mechanism for rendering images and other compressed files to the consumer""s computer.